home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / widgets / include / GL / GLwDrawA.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-05  |  6.8 KB  |  197 lines

  1. /* GLwDrawA.h -- Mesa GL Widget for X11 Toolkit Programming
  2.    Copyright (C) 1995 by
  3.      Jeroen van der Zijp <jvz@cyberia.cfdrc.com>
  4.      Thorsten Ohl <Thorsten.Ohl@Physik.TH-Darmstadt.de>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License as published by the Free Software Foundation; either
  9.    version 2 of the License, or (at your option) any later version.
  10.  
  11.    This library is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU Library General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU Library General Public
  17.    License along with this library; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.    $Id: GLwDrawA.h,v 1.3 1995/04/08 16:25:28 ohl Exp $
  21.  */
  22.  
  23. #ifndef _GLwDrawingArea_h
  24. #define _GLwDrawingArea_h
  25.  
  26. #include <GL/gl.h>
  27. #include <GL/glx.h>
  28.  
  29.  
  30. /*
  31.    New resources available in this widget:
  32.  
  33.    Resource name       Resource class     Resource type   Initial Value
  34.    =============       ==============     =============   =============
  35.    attribList          AttribList         int*            NULL
  36.    visualInfo          VisualInfo         VisualInfo      NULL
  37.    installColormap     InstallColormap    Boolean         TRUE
  38.    allocateBackground  AllocateColors     Boolean         FALSE
  39.    allocateOtherColors AllocateColors     Boolean         FALSE
  40.    installBackground   InstallBackground  Boolean         TRUE
  41.    ginitCallback       Callback           Pointer         NULL
  42.    exposeCallback      Callback           Pointer         NULL
  43.    inputCallback       Callback           Pointer         NULL
  44.    resizeCallback      Callback           Pointer         NULL
  45.    rgba                Rgba               Boolean         FALSE
  46.    doublebuffer        Doublebuffer       Boolean         FALSE
  47.    stereo              Stereo             Boolean         FALSE
  48.    bufferSize          BufferSize         int             0
  49.    level               Level              int             0
  50.    auxBuffers          AuxBuffers         int             0
  51.    redSize             ColorSize          int             1
  52.    greenSize           ColorSize          int             1
  53.    blueSize            ColorSize          int             1
  54.    alphaSize           AlphaSize          int             0
  55.    depthSize           DepthSize          int             0
  56.    stencilSize         StencilSize        int             0
  57.    accumRedSize        AccumColorSize     int             0
  58.    accumGreenSize      AccumColorSize     int             0
  59.    accumBlueSize       AccumColorSize     int             0
  60.    accumAlphaSize      AccumAlphaSize     int             0
  61.  
  62.  */
  63.  
  64. /* Resource names */
  65. #define GLwNdebug        "debug"
  66. #define GLwNattribList          "attribList"
  67. #define GLwNvisualInfo          "visualInfo"
  68. #define GLwNinstallColormap     "installColormap"
  69. #define GLwNallocateBackground  "allocateBackground"
  70. #define GLwNallocateOtherColors "allocateOtherColors"
  71. #define GLwNinstallBackground   "installBackground"
  72. #define GLwNexposeCallback      "exposeCallback"
  73. #define GLwNginitCallback       "ginitCallback"
  74. #define GLwNresizeCallback      "resizeCallback"
  75. #define GLwNinputCallback       "inputCallback"
  76. #define GLwNbufferSize          "bufferSize"
  77. #define GLwNlevel               "level"
  78. #define GLwNrgba                "rgba"
  79. #define GLwNdoublebuffer        "doublebuffer"
  80. #define GLwNstereo              "stereo"
  81. #define GLwNauxBuffers          "auxBuffers"
  82. #define GLwNredSize             "redSize"
  83. #define GLwNgreenSize           "greenSize"
  84. #define GLwNblueSize            "blueSize"
  85. #define GLwNalphaSize           "alphaSize"
  86. #define GLwNdepthSize           "depthSize"
  87. #define GLwNstencilSize         "stencilSize"
  88. #define GLwNaccumRedSize        "accumRedSize"
  89. #define GLwNaccumGreenSize      "accumGreenSize"
  90. #define GLwNaccumBlueSize       "accumBlueSize"
  91. #define GLwNaccumAlphaSize      "accumAlphaSize"
  92.  
  93. /* Resource classes */
  94. #define GLwCDebug        "Debug"
  95.  
  96. #define GLwCAttribList          "AttribList"
  97. #define GLwCVisualInfo          "VisualInfo"
  98.  
  99. #define GLwCInstallColormap     "InstallColormap"
  100. #define GLwCAllocateColors      "AllocateColors"
  101. #define GLwCInstallBackground   "InstallBackground"
  102.  
  103. #define GLwCCallback            "Callback"
  104.  
  105. #define GLwCBufferSize          "BufferSize"
  106. #define GLwCLevel               "Level"
  107. #define GLwCRgba                "Rgba"
  108. #define GLwCDoublebuffer        "Doublebuffer"
  109. #define GLwCStereo              "Stereo"
  110. #define GLwCAuxBuffers          "AuxBuffers"
  111. #define GLwCColorSize           "ColorSize"
  112. #define GLwCAlphaSize           "AlphaSize"
  113. #define GLwCDepthSize           "DepthSize"
  114. #define GLwCStencilSize         "StencilSize"
  115. #define GLwCAccumColorSize      "AccumColorSize"
  116. #define GLwCAccumAlphaSize      "AccumAlphaSize"
  117.  
  118. /* Resource type for VisualInfo */
  119. #define GLwRVisualInfo          "VisualInfo"
  120.  
  121.  
  122. #ifdef __GLX_MOTIF
  123.  
  124. /* Motif-based widget */
  125. typedef struct _GLwMDrawingAreaClassRec *GLwMDrawingAreaWidgetClass;
  126. typedef struct _GLwMDrawingAreaRec *GLwMDrawingAreaWidget;
  127.  
  128. extern WidgetClass glwMDrawingAreaWidgetClass;
  129.  
  130. #else
  131.  
  132. /* Xt-based widget */
  133. typedef struct _GLwDrawingAreaClassRec *GLwDrawingAreaWidgetClass;
  134. typedef struct _GLwDrawingAreaRec *GLwDrawingAreaWidget;
  135.  
  136. extern WidgetClass glwDrawingAreaWidgetClass;
  137.  
  138. #endif
  139.  
  140. /* Callback Reasons */
  141. #ifdef __GLX_MOTIF
  142. #define GLwCR_EXPOSE XmCR_EXPOSE
  143. #define GLwCR_RESIZE XmCR_RESIZE
  144. #define GLwCR_INPUT  XmCR_INPUT
  145. #else
  146. #define GLwCR_EXPOSE 38
  147. #define GLwCR_RESIZE 39
  148. #define GLwCR_INPUT  40
  149. #endif
  150. #define GLwCR_GINIT  32135
  151.  
  152. /************************************************************************
  153.  *                Callback Structure for Mesa Widget                     *
  154.  ************************************************************************/
  155.  
  156. typedef struct
  157.   {
  158.     int reason;
  159.     XEvent *event;
  160.     Dimension width, height;
  161.   }
  162. GLwDrawingAreaCallbackStruct;
  163.  
  164.  
  165. /************************************************************************
  166.  *                       Mesa Widget Functions                           *
  167.  ************************************************************************/
  168.  
  169. #if defined(__cplusplus) || defined(c_plusplus)
  170. extern "C"
  171. {
  172. #endif
  173.  
  174. /* front ends to glXMakeCurrent and glXSwapBuffers */
  175. #ifdef _NO_PROTO
  176.   extern void GLwDrawingAreaMakeCurrent ();
  177.   extern void GLwDrawingAreaSwapBuffers ();
  178. #else
  179.   extern void GLwDrawingAreaMakeCurrent (Widget w, GLXContext ctx);
  180.   extern void GLwDrawingAreaSwapBuffers (Widget w);
  181. #endif
  182.  
  183. #ifdef __GLX_MOTIF
  184. #ifdef _NO_PROTO
  185.   extern Widget GLwCreateMDrawingArea ();
  186. #else
  187.   extern Widget GLwCreateMDrawingArea (Widget parent, char *name, ArgList arglist, Cardinal argcount);
  188. #endif
  189. #endif
  190.  
  191. #if defined(__cplusplus) || defined(c_plusplus)
  192. }
  193. #endif
  194.  
  195. #endif /* _GLwDrawingArea_h */
  196.  
  197.